﻿/*
 * @author: wizardc
 */

using System;

namespace Dou.Resource
{
    /// <summary>
    /// 资源自动卸载类型
    /// </summary>
    public enum AssetUnloadType
    {
        /// <summary>
        /// 立即卸载
        /// </summary>
        Immediate,
        /// <summary>
        /// 不卸载
        /// </summary>
        Never,
        /// <summary>
        /// 指定时间后卸载
        /// </summary>
        Delay
    }
    
    /// <summary>
    /// 资源自动卸载设置
    /// </summary>
    [Serializable]
    public class AssetUnloadSetting
    {
        /// <summary>
        /// AB 包名
        /// </summary>
        public string abName;

        /// <summary>
        /// 卸载类型
        /// </summary>
        public AssetUnloadType type;

        /// <summary>
        /// 类型为 Delay 时的卸载延时，单位秒
        /// </summary>
        public float delayTime;

        /// <summary>
        /// 卸载时是否同时卸载已加载到内存的资源
        /// </summary>
        public bool unloadAllLoadedObjects = true;
    }
}
